import redis

# 创建 Redis 连接对象
r = redis.Redis(host='localhost', port=6379, db=0)

# 添加元素到有序集合
r.zadd('scores', {'Alice': 80, 'Bob': 90, 'Charlie': 70})

# 获取有序集合中指定分数范围的元素
top_scores = r.zrangebyscore('scores', min=80, max=100)
for score in top_scores:
    print(score.decode('utf-8'))